package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LitemallTypeMapper;
import org.linlinjava.litemall.db.domain.LitemallType;
import org.linlinjava.litemall.db.domain.LitemallTypeExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.xml.ws.Response;
import java.util.List;

@Service
public class LitemallTypeService {

    @Resource
    private LitemallTypeMapper typeMapper;


    public List<LitemallType> queryByType() {
        LitemallTypeExample example=new LitemallTypeExample();
        List<LitemallType> types = typeMapper.selectByExample(example);
        return types;
    }

    public Object create(LitemallType litemallType) {
        int i = typeMapper.insertSelective(litemallType);
        return i;
    }

    public LitemallType selectType(String pid) {
        return typeMapper.selectByPid(pid);
    }

    public int deleteById(int id){
        return typeMapper.deleteByPrimaryKey(id);
    }
}
